package com.logistics.qrcode.controller;

import com.logistics.qrcode.service.QrcodeService;
import com.logistics.utils.constants.Constants;
import com.logistics.utils.response.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("lgs/qrcode")
public class QrcodeController {

    @Autowired
    private QrcodeService qrcodeService;

    /**
     * code码查询value值
     * @param code
     * @return
     */
    @GetMapping("valueByCode/{code}")
    public ResponseEntity valueByCode(@PathVariable("code") String code) {
        return ResponseUtil.success(qrcodeService.valueByCode(code, Constants.CODE_TYPE_LOCATION));
    }
}
